<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>53数组去重若干方法3</title>
</head>
<body>

<script>
  let arr = [1,2,3,4,44,42,21,3,3,2,4,5,5,3,2,2]
  function uniqueArr(array) {
    return array.filter(function (item,index) {
      return array.indexOf(item) === index
    })
  }

  let newArr = uniqueArr(arr).sort(function (a,b) {
    return a-b
  });

  console.log(newArr);


</script>
</body>
</html>